﻿CREATE PROCEDURE [dbo].[InstructionInsert]
(@JobID UniqueIdentifier,
@ComponentID UniqueIdentifier,
@Data varchar(max))
AS begin
	if exists (select * from Instruction where JobID=@JobID) begin
		update Instruction set 
			ComponentID=@ComponentID,
			Data=@Data
		where
			JobID=@JobID;
	end
	else begin
		insert into Instruction (
			JobID,
			ComponentID,
			Data) 
		values (
			@JobID,
			@ComponentID,
			@Data);
	end
end